import Vue from 'vue'

// 工具库
import _ from 'lodash'
import requireComponents from './plugins'

import ElementUI from 'element-ui'
import '@/styles/element-variables.scss'
// import 'element-ui/lib/theme-chalk/index.css'
import wzTable from '@/components/basic/cTable.vue'
import TCollapse from '@/components/basic/TCollapse.vue'
import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission'

// filter 过滤器
import { formatNum, toThousandFilter, uppercaseFirst } from './filters'
import { fixIframe, fixIframeArr } from '@/utils/IframeFix'
Vue.prototype.$fixIframe = fixIframe
Vue.prototype.$fixIframeArr = fixIframeArr
// axios
import './utils/drag'
Vue.use(ElementUI)
// 修改 el-dialog 全局默认点击遮照为不关闭
ElementUI.Dialog.props.closeOnClickModal.default = false
// 全局挂在组件
Vue.use(requireComponents)
Vue.component('wzTable', wzTable)
Vue.component('TCollapse', TCollapse)
// 算法精度丢失问题
import { multiply, add, subtract, divide } from 'accurate'
Vue.prototype.$multiply = multiply
Vue.prototype.$add = add
Vue.prototype.$subtract = subtract
Vue.prototype.$divide = divide

// 全局注入过滤器filters
Vue.filter('formatNum', formatNum)
Vue.filter('toThousandFilter', toThousandFilter)
Vue.filter('uppercaseFirst', uppercaseFirst)

import 'normalize.css/normalize.css'
import '@/styles/index.scss'

// 全局属性
Vue.prototype._ = _

Vue.config.productionTip = false

// new Vue({
//   el: '#app',
//   router,
//   store,
//   render: h => h(App)
// })

const createVue = new Vue({
    // el: '#app',
    router,
    store,
    render: h => h(App)
  })
  createVue.$mount('#app')
